<?php
// print_r($_GET);
$username = $_GET['username'];
$age = $_GET['age'];
$gender = $_GET['gender'];

// 连接数据库
$link = mysqli_connect("localhost","root","root","2116");
$sql = "INSERT INTO students(username,age,gender) VALUES('$username',$age,'$gender')";
mysqli_query($link,$sql);
if(mysqli_affected_rows($link)){
	// echo "添加成功";
	echo "<script>alert('添加成功'); window.location.href='./index.php'</script>";
}else{
	echo "添加失败";
}


?>